package vn.edu.saigontech.ncms.web.receipt.report;

import java.util.Date;

import vn.edu.saigontech.ncms.service.ReceiptService;
import vn.edu.saigontech.ncms.util.Checker;

public class ReceiptMaintenanceMonthlyBean {
	private Date maintenanceDate;
	private String lastName;
	private String firstName;
	private Date dob;
	private String phone;
	private String offeringName;
	private String receiptNumber;
	private String maintenanceNumber;
	private Double maintenanceFee;
	private Date newOfferingDate;
	private String newOfferingName;
	private Date newOfferingStartDate;
	private String newReceiptNumber;
	private Double useFee;
	private Double remainFee;
	private String reason;
	
	public ReceiptMaintenanceMonthlyBean(Object[] obj) {
		this.maintenanceDate = (Date) obj[0];
		this.lastName = (String) obj[1];
		this.firstName = (String) obj[2];
		this.dob = (Date) obj[3];
		this.phone = (String) obj[4];
		this.offeringName = (String) obj[5];
		this.receiptNumber = (String) obj[6];
		this.maintenanceNumber = (String) obj[7];
		this.maintenanceFee = (Double) obj[8];
		this.reason = (String) obj[9];
		
		Long maintenanceId = (Long) obj[10];
		Object[] laterReceipt = ReceiptService.INSTANCE.findInfoByMaintenanceId(maintenanceId);
		
		if (Checker.isNotNull(laterReceipt)) {
			this.newOfferingDate = (Date) laterReceipt[0];
			this.newOfferingName = (String) laterReceipt[1];
			this.newOfferingStartDate = (Date) laterReceipt[2];
			this.newReceiptNumber = (String) laterReceipt[3];
			this.useFee = (Double) obj[8];
		} else {
			this.remainFee = (Double) obj[8]; 
		}
	}
	
	public Date getMaintenanceDate() {
		return maintenanceDate;
	}
	
	public void setMaintenanceDate(Date maintenanceDate) {
		this.maintenanceDate = maintenanceDate;
	}
	
	public String getLastName() {
		return lastName;
	}
	
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	
	public String getFirstName() {
		return firstName;
	}
	
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	
	public Date getDob() {
		return dob;
	}
	
	public void setDob(Date dob) {
		this.dob = dob;
	}
	
	public String getPhone() {
		return phone;
	}
	
	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	public String getOfferingName() {
		return offeringName;
	}
	
	public void setOfferingName(String offeringName) {
		this.offeringName = offeringName;
	}
	
	public String getMaintenanceNumber() {
		return maintenanceNumber;
	}
	
	public void setMaintenanceNumber(String maintenanceNumber) {
		this.maintenanceNumber = maintenanceNumber;
	}
	
	public Double getMaintenanceFee() {
		return maintenanceFee;
	}
	
	public void setMaintenanceFee(Double maintenanceFee) {
		this.maintenanceFee = maintenanceFee;
	}
	
	public Date getNewOfferingDate() {
		return newOfferingDate;
	}
	
	public void setNewOfferingDate(Date newOfferingDate) {
		this.newOfferingDate = newOfferingDate;
	}
	
	public String getNewOfferingName() {
		return newOfferingName;
	}
	
	public void setNewOfferingName(String newOfferingName) {
		this.newOfferingName = newOfferingName;
	}
	
	public Date getNewOfferingStartDate() {
		return newOfferingStartDate;
	}
	
	public void setNewOfferingStartDate(Date newOfferingStartDate) {
		this.newOfferingStartDate = newOfferingStartDate;
	}
	
	public String getNewReceiptNumber() {
		return newReceiptNumber;
	}
	
	public void setNewReceiptNumber(String newReceiptNumber) {
		this.newReceiptNumber = newReceiptNumber;
	}
	
	public Double getUseFee() {
		return useFee;
	}
	
	public void setUseFee(Double useFee) {
		this.useFee = useFee;
	}
	
	public Double getRemainFee() {
		return remainFee;
	}
	
	public void setRemainFee(Double remainFee) {
		this.remainFee = remainFee;
	}
	
	public String getReason() {
		return reason;
	}
	
	public void setReason(String reason) {
		this.reason = reason;
	}
	
	public String getReceiptNumber() {
		return receiptNumber;
	}

	public void setReceiptNumber(String receiptNumber) {
		this.receiptNumber = receiptNumber;
	}
}